<template>
	<view class="themeItem">
		<!-- :url="'/pages/classlist/classlist?id='+bookTypes.booktypeId+'&name='+bookTypes.booktypes" -->
		<view class="box" v-if="!isMore" @click="toDetail(item.id)">
			<image class="pic" :src="item.avatar" mode="aspectFill"></image>
			<view class="mask">{{item.name}}</view>
		</view>

		<!-- url="/pages/classify/classify" open-type="reLaunch" -->
		<view class="box more" v-if="isMore" @click="toMore">
			<image class="pic" src="../../common/image/1.jpeg" mode="aspectFill"></image>
			<view class="mask">
				<uni-icons type="more-filled" size="34" color="#fff"></uni-icons>
				<view class="text">更多</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	defineProps({
		isMore: {
			type: Boolean,
			default: false
		},

		item: {}
	})
	const toDetail = (id) => {
		uni.navigateTo({
			url: '/pages/teacher/teacherDetail?id=' + id
		})
	}
	const toMore = () => {
		uni.navigateTo({
			url: '/pages/teacher/allTeacher'
		})
	}
</script>

<style lang="scss" scoped>
	.themeItem {
		.box {
			height: 340rpx;
			border-radius: 10rpx;
			overflow: hidden;
			position: relative;

			.pic {
				width: 100%;
				height: 100%;
			}

			.mask {
				width: 100%;
				height: 70rpx;
				position: absolute;
				bottom: 0;
				left: 0;
				background: rgba(0, 0, 0, 0.2);
				color: #fff;
				display: flex;
				align-items: center;
				justify-content: center;
				backdrop-filter: blur(20rpx);
				font-weight: 600;
			}

		}

		.box.more {
			.mask {
				width: 100%;
				height: 100%;
			}

			.text {
				font-size: 28rpx;
			}
		}
	}
</style>